package Day05;

import java.util.Scanner;

import org.junit.Test;

public class OOPTest {
	public class Student {
		private int ID;
		private String name;
		private int  age;
		
		public Student(int iD, String name, int age) {
		//	super();
			ID = iD;
			this.name = name;
			this.age = age;
		}

		public int getID() {
			return ID;
		}

		public void setID(int iD) {
			ID = iD;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public int getAge() {
			return age;
		}

		public void setAge(int age) {
			this.age = age;
		}

		
		@Override
		public String toString() {
			return "Student [ID=" + ID + ", name=" + name + ", age=" + age + "]";
		}
		
		
		
	}
	@Test
	public void Test01() {
			Scanner input = new  Scanner(System.in);
			Student stu = new Student(001, "zjx", 21);
			System.out.println(stu);
			System.out.println("请输入学生ID：");
			stu.setID(input.nextInt());
			System.out.println("请输入学生姓名：");
			stu.setName(input.next());
			System.out.println("请输入学生年龄：");
			stu.setAge(input.nextInt());
			System.out.println(stu);
			
			
	}
}
